#include <iostream>
#include <cstring>

using namespace std;

/* struct stu
{
    string name;    
    double score;
    int age;

    stu(){
        cout<<"无参构造函数"<<endl;
    }
    stu(string name,double score,int age){
        this->name=name;
        this->age=age;
        this->score=score;
        cout<<"有参构造函数"<<endl;
    }
   /*  stu(string name,double score,int age):name(name),score(score),age(age){
        cout << "自动参数列表" << endl;
    }  
   ~stu(){
    cout << "析构函数" << endl;
   }

}; */

struct stu
{
    char *name;
    stu(){
        name=NULL;
        cout<<"构造函数" << endl;
    }
    stu(char* e){
        this->name = new char[20];
         strcpy(name, e);
         cout<<"构造函数" << endl;
    }
    ~stu(){
        //if(name)
        delete[] name;
        cout<<"析构函数"<<endl;
    }
};

int main()
{
    stu a("肖欢");
    stu b;


    return 0;
}